{{include file="Manage/header.html"}}
<body>
{{include file="Manage/menu.html"}}
<div class="index_main">
    {{include file="Manage/menu2.html"}}
    <div class="pro_manage">
            <div class="center">
                <div class="query">
                    <button class="">学生</button>
                    <span>&nbsp;&nbsp;&nbsp;&nbsp;|</span>
                    <button class="">老师</button>
                    <button>插入角色</button>
                    <a href="index.php?app=Role&act=modify"><button>批量插入</button></a>
                    <input type="text" name="keyword" id="keyword" placeholder="要查询的老师和学生" value="{{if $smarty.get.keyword}}{{$smarty.get.keyword}}{{/if}}">
                    <button type="submit" class="" id="submit" name="submit" >查询</button>
                </div>
                <div class="projects">
                    <table>
                        <tr>
                            <th>编号或学号</th>
                            <th>姓名</th>
                            <th>所属院系</th>
                            <th>手机号</th>
                            <th>电子邮箱</th>
                            <th>操作</th>
                        </tr>
                        {{if $list.data}}
                        {{foreach from=$list.data item=val key=key}}
                        <tr>
                            <td>{{$val.uid}}</td>
                            <td>{{$val.name}}</td>
                            <td>{{$val.college}}</td>
                            <td>{{$val.number}}</td>
                            <td>{{$val.email}}</td>
                            <td><a href="{{$smarty.const.__PUB__}}{{$val.files}}" target="_blank">删除</a></td>
                        </tr>
                        {{/foreach}}
                        {{/if}}

                    </table>
                    <div class="page">
                        <div class="pager">
                            {{if $pagenav}}
                            {{$pagenav}}
                            {{elseif $page.html}}
                            {{$page.html}}
                            {{elseif $list.page.html}}
                            {{$list.page.html}}
                            {{/if}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
</div>
</div>
<script type="text/javascript">
$(function(){
        //ajax方式提交当前表单数据
        $("#submit").on("click", function(event){
            $.ajax({
                type: "POST",
                url: "index.php?app=Role&act=search",
                data: $("#keyword").serialize(),
                dataType: "json",
                success: function(data){
                    if (data.status == 1) {
                        alert(data.message);
                    } else {
                        alert(data.message);

                    }
                }
            });

        })
});

</script>
{{include file="Manage/footer.html"}}